package com.xs.ahoi.hcxs.handler;

import android.app.NotificationManager;
import android.content.Context;
import com.xs.ahoi.hcxs.Ahoi;
import com.xs.ahoi.hcxs.service.BookFactory;

/**
 * 通知父类
 *
 * @author fuhuichao
 * @date 2020-07-14 20:52
 */
public abstract class BaseNotifyHandler {

    public static int BASE_NOTIFY_ID = 1001;

    public static BookFactory bookFactory = BookFactory.getInstance();

    public static NotificationManager notificationManager = (NotificationManager) Ahoi.getInstance().getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);

    // 取消播放通知
    public void cancelPlay(int notifyId) {
        notificationManager.cancel(notifyId);
    }

    // 取消全部通知
    public static void cancelAll() {
        notificationManager.cancelAll();
    }

    public static int getNewNotifyId() {
        BASE_NOTIFY_ID++;
        return BASE_NOTIFY_ID;
    }
}
